package com.hongdee.market.grievance.service.impl;

import com.hongdee.common.util.StringUtil;
import com.hongdee.market.grievance.mapper.ITMarketWhineApprovalMapper;
import com.hongdee.market.grievance.pojo.TMarketWhineApprovalPojo;
import com.hongdee.market.grievance.service.ITMarketWhineApprovalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Map;

/**
 * Created by Liu XiaoLong
 * Date: 2017/10/31.
 * Remark:
 */
@Service
public class TMarketWhineApprovalServiceImpl implements ITMarketWhineApprovalService {

    @Autowired
    private ITMarketWhineApprovalMapper itMarketWhineApprovalMapper;
    /**
     * @Name: 保存
     * @Author: Liu XiaoLong
     * @Date: 2017/10/31 14:35
     * @Remark:
     */
    @Override
    public Map save(TMarketWhineApprovalPojo tMarketWhineApprovalPojo) throws Exception {
        if(tMarketWhineApprovalPojo.getId() == null || tMarketWhineApprovalPojo.getId().length() == 0){
            tMarketWhineApprovalPojo.setId(StringUtil.UUID());
            itMarketWhineApprovalMapper.Insert(tMarketWhineApprovalPojo);
        }
        else {
            itMarketWhineApprovalMapper.UpdatePoJo(tMarketWhineApprovalPojo);
        }
        return null;
    }
}
